<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   Kafka深度解析，众人推荐，精彩好文！  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://dataunion.org/9307.html",
                  host: "http://dataunion.org",
                  prePath: "http://dataunion.org",
                  scheme: "http",
                  pathBase: "http://dataunion.org/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466459375: Accept with keywords: (title(0.0):社区,文,数盟,精彩,深度,众人, topn(0.266666666667):队列,数盟,长度,机制,数量,文件,结果,机器,模式,文章,数据,场景,处理过程,字节,宕机,性能,离线,Hadoop,网卡,实例,磁盘,异步,顺序,方式,系统,入队,集群,消息,数据量,无法).-->
 </head>
 <body onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    Kafka深度解析，众人推荐，精彩好文！
   </h1>
  </div>
  <div class="container" id="xmain">
   ﻿﻿
   <title>
    Kafka深度解析，众人推荐，精彩好文！ | 数盟社区
   </title>
   <!-- All in One SEO Pack 2.2.7.6.2 by Michael Torbert of Semper Fi Web Design[32,67] -->
   <!-- /all in one seo pack -->
   <!--
<div align="center">
<a href="http://strata.oreilly.com.cn/hadoop-big-data-cn?cmp=mp-data-confreg-home-stcn16_dataunion_pc" target="_blank"><img src="http://dataunion.org/wp-content/uploads/2016/05/stratabj.jpg"/ ></a>
</div>
-->
   <header id="header-web">
    <div class="header-main">
     <hgroup class="logo">
      <h1>
       <a href="http://dataunion.org/" rel="home" title="数盟社区">
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/logo.png"/>
       </a>
      </h1>
     </hgroup>
     <!--logo-->
     <nav class="header-nav">
      <ul class="menu" id="menu-%e4%b8%bb%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-71" id="menu-item-71">
        <a href="http://dataunion.org/category/events" title="events">
         活动
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22457" id="menu-item-22457">
          <a href="http://dataunion.org/2016timeline">
           2016档期
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22459" id="menu-item-22459">
          <a href="http://dataunion.org/category/parterc">
           合作会议
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor menu-item-has-children menu-item-20869" id="menu-item-20869">
        <a href="http://dataunion.org/category/tech" title="articles">
         文章
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-20867" id="menu-item-20867">
          <a href="http://dataunion.org/category/tech/base" title="base">
           基础架构
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3302" id="menu-item-3302">
          <a href="http://dataunion.org/category/tech/ai" title="ai">
           人工智能
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3303" id="menu-item-3303">
          <a href="http://dataunion.org/category/tech/analysis" title="analysis">
           数据分析
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21920" id="menu-item-21920">
          <a href="http://dataunion.org/category/tech/dm">
           数据挖掘
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3314" id="menu-item-3314">
          <a href="http://dataunion.org/category/tech/viz" title="viz">
           可视化
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3305" id="menu-item-3305">
          <a href="http://dataunion.org/category/tech/devl" title="devl">
           编程语言
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-20876" id="menu-item-20876">
        <a href="http://dataunion.org/category/industry">
         行业
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-16328" id="menu-item-16328">
          <a href="http://dataunion.org/category/industry/case" title="case">
           行业应用
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-2112" id="menu-item-2112">
          <a href="http://dataunion.org/category/industry/demo" title="demo">
           Demo展示
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21562" id="menu-item-21562">
          <a href="http://dataunion.org/category/industry/news">
           行业资讯
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-311" id="menu-item-311">
        <a href="http://dataunion.org/category/sources" title="sources">
         资源
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20870" id="menu-item-20870">
        <a href="http://dataunion.org/category/books" title="book">
         图书
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21363" id="menu-item-21363">
        <a href="http://dataunion.org/category/training">
         课程
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-21853" id="menu-item-21853">
        <a href="http://dataunion.org/category/jobs">
         职位
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22050" id="menu-item-22050">
          <a href="http://dataunion.org/category/career">
           职业规划
          </a>
         </li>
        </ul>
       </li>
      </ul>
     </nav>
     <!--header-nav-->
    </div>
   </header>
   <!--header-web-->
   <div id="main">
    <div id="soutab">
     <form action="http://dataunion.org/" class="search" method="get">
     </form>
    </div>
    <div id="container">
     <nav id="mbx">
      当前位置：
      <a href="http://dataunion.org">
       首页
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech">
       文章
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech/base">
       基础架构
      </a>
      &gt;  正文
     </nav>
     <!--mbx-->
     <article class="content">
      <header align="centre" class="contenttitle">
       <div class="mscc">
        <h1 class="mscctitle">
         <a href="http://dataunion.org/9307.html">
          Kafka深度解析，众人推荐，精彩好文！
         </a>
        </h1>
        <address class="msccaddress ">
         <em>
          4,808 次阅读 -
         </em>
         <a href="http://dataunion.org/category/tech/base" rel="category tag">
          基础架构
         </a>
        </address>
       </div>
      </header>
      <div class="content-text">
       <p>
        作者：
        <a href="http://www.jasongj.com/2015/01/02/Kafka%E6%B7%B1%E5%BA%A6%E8%A7%A3%E6%9E%90/jasongj.com" title="Jason Guo">
         Jason Guo
        </a>
       </p>
       <h1 id="背景介绍">
        背景介绍
       </h1>
       <h2 id="Kafka简介">
        Kafka简介
       </h2>
       <p>
        Kafka是一种分布式的，基于发布/订阅的消息系统。主要设计目标如下：
       </p>
       <ul>
        <li>
         以时间复杂度为O(1)的方式提供消息持久化能力，并保证即使对TB级以上数据也能保证常数时间的访问性能
        </li>
        <li>
         高吞吐率。即使在非常廉价的商用机器上也能做到单机支持每秒100K条消息的传输
        </li>
        <li>
         支持Kafka Server间的消息分区，及分布式消息消费，同时保证每个partition内的消息顺序传输
        </li>
        <li>
         同时支持离线数据处理和实时数据处理
        </li>
       </ul>
       <h2 id="为什么要用Message_Queue">
        为什么要用Message Queue
       </h2>
       <ul>
        <li>
         <b>
          解耦
         </b>
         <br/>
         在项目启动之初来预测将来项目会碰到什么需求，是极其困难的。消息队列在处理过程中间插入了一个隐含的、基于数据的接口层，两边的处理过程都要实现这一接口。这允许你独立的扩展或修改两边的处理过程，只要确保它们遵守同样的接口约束
        </li>
        <li>
         <strong>
          冗余
         </strong>
         <br/>
         有时在处理数据的时候处理过程会失败。除非数据被持久化，否则将永远丢失。消息队列把数据进行持久化直到它们已经被完全处理，通过这一方式规避了数据丢失风险。在被许多消息队列所采用的”插入-获取-删除”范式中，在把一个消息从队列中删除之前，需要你的处理过程明确的指出该消息已经被处理完毕，确保你的数据被安全的保存直到你使用完毕。
        </li>
        <li>
         <strong>
          扩展性
         </strong>
         <br/>
         因为消息队列解耦了你的处理过程，所以增大消息入队和处理的频率是很容易的；只要另外增加处理过程即可。不需要改变代码、不需要调节参数。扩展就像调大电力按钮一样简单。
        </li>
        <li>
         <strong>
          灵活性 &amp; 峰值处理能力
         </strong>
         <br/>
         在访问量剧增的情况下，应用仍然需要继续发挥作用，但是这样的突发流量并不常见；如果为以能处理这类峰值访问为标准来投入资源随时待命无疑是巨大的浪费。使用消息队列能够使关键组件顶住增长的访问压力，而不是因为超出负荷的请求而完全崩溃。
        </li>
        <li>
         <strong>
          可恢复性
         </strong>
         <br/>
         当体系的一部分组件失效，不会影响到整个系统。消息队列降低了进程间的耦合度，所以即使一个处理消息的进程挂掉，加入队列中的消息仍然可以在系统恢复后被处理。而这种允许重试或者延后处理请求的能力通常是造就一个略感不便的用户和一个沮丧透顶的用户之间的区别。
        </li>
        <li>
         <strong>
          送达保证
         </strong>
         <br/>
         消息队列提供的冗余机制保证了消息能被实际的处理，只要一个进程读取了该队列即可。在此基础上，IronMQ提供了一个”只送达一次”保证。无论有多少进程在从队列中领取数据，每一个消息只能被处理一次。这之所以成为可能，是因为获取一个消息只是”预定”了这个消息，暂时把它移出了队列。除非客户端明确的表示已经处理完了这个消息，否则这个消息会被放回队列中去，在一段可配置的时间之后可再次被处理。
        </li>
       </ul>
       <ul>
        <li>
         <strong>
          顺序保证
         </strong>
         <br/>
         在许多情况下，数据处理的顺序都很重要。消息队列本来就是排序的，并且能保证数据会按照特定的顺序来处理。IronMO保证消息浆糊通过FIFO（先进先出）的顺序来处理，因此消息在队列中的位置就是从队列中检索他们的位置。
        </li>
        <li>
         <strong>
          缓冲
         </strong>
         <br/>
         在任何重要的系统中，都会有需要不同的处理时间的元素。例如,加载一张图片比应用过滤器花费更少的时间。消息队列通过一个缓冲层来帮助任务最高效率的执行—写入队列的处理会尽可能的快速，而不受从队列读的预备处理的约束。该缓冲有助于控制和优化数据流经过系统的速度。
        </li>
        <li>
         <strong>
          理解数据流
         </strong>
         <br/>
         在一个分布式系统里，要得到一个关于用户操作会用多长时间及其原因的总体印象，是个巨大的挑战。消息系列通过消息被处理的频率，来方便的辅助确定那些表现不佳的处理过程或领域，这些地方的数据流都不够优化。
        </li>
        <li>
         <strong>
          异步通信
         </strong>
         <br/>
         很多时候，你不想也不需要立即处理消息。消息队列提供了异步处理机制，允许你把一个消息放入队列，但并不立即处理它。你想向队列中放入多少消息就放多少，然后在你乐意的时候再去处理它们。
        </li>
       </ul>
       <h2 id="常用Message_Queue对比">
        常用Message Queue对比
       </h2>
       <ul>
        <li>
         <strong>
          RabbitMQ
         </strong>
         <br/>
         RabbitMQ是使用Erlang编写的一个开源的消息队列，本身支持很多的协议：AMQP，XMPP, SMTP, STOMP，也正因如此，它非常重量级，更适合于企业级的开发。同时实现了Broker构架，这意味着消息在发送给客户端时先在中心队列排队。对路由，负载均衡或者数据持久化都有很好的支持。
        </li>
        <li>
         <strong>
          Redis
         </strong>
         <br/>
         Redis是一个基于Key-Value对的NoSQL数据库，开发维护很活跃。虽然它是一个Key-Value数据库存储系统，但它本身支持MQ功能，所以完全可以当做一个轻量级的队列服务来使用。对于RabbitMQ和Redis的入队和出队操作，各执行100万次，每10万次记录一次执行时间。测试数据分为128Bytes、512Bytes、1K和10K四个不同大小的数据。实验表明：入队时，当数据比较小时Redis的性能要高于RabbitMQ，而如果数据大小超过了10K，Redis则慢的无法忍受；出队时，无论数据大小，Redis都表现出非常好的性能，而RabbitMQ的出队性能则远低于Redis。
        </li>
        <li>
         <strong>
          ZeroMQ
         </strong>
         <br/>
         ZeroMQ号称最快的消息队列系统，尤其针对大吞吐量的需求场景。ZMQ能够实现RabbitMQ不擅长的高级/复杂的队列，但是开发人员需要自己组合多种技术框架，技术上的复杂度是对这MQ能够应用成功的挑战。ZeroMQ具有一个独特的非中间件的模式，你不需要安装和运行一个消息服务器或中间件，因为你的应用程序将扮演了这个服务角色。你只需要简单的引用ZeroMQ程序库，可以使用NuGet安装，然后你就可以愉快的在应用程序之间发送消息了。但是ZeroMQ仅提供非持久性的队列，也就是说如果down机，数据将会丢失。其中，Twitter的Storm中默认使用ZeroMQ作为数据流的传输。
        </li>
        <li>
         <strong>
          ActiveMQ
         </strong>
         <br/>
         ActiveMQ是Apache下的一个子项目。 类似于ZeroMQ，它能够以代理人和点对点的技术实现队列。同时类似于RabbitMQ，它少量代码就可以高效地实现高级应用场景。
        </li>
        <li>
         <strong>
          Kafka/Jafka
         </strong>
         <br/>
         Kafka是Apache下的一个子项目，是一个高性能跨语言分布式Publish/Subscribe消息队列系统，而Jafka是在Kafka之上孵化而来的，即Kafka的一个升级版。具有以下特性：快速持久化，可以在O(1)的系统开销下进行消息持久化；高吞吐，在一台普通的服务器上既可以达到10W/s的吞吐速率；完全的分布式系统，Broker、Producer、Consumer都原生自动支持分布式，自动实现复杂均衡；支持Hadoop数据并行加载，对于像Hadoop的一样的日志数据和离线分析系统，但又要求实时处理的限制，这是一个可行的解决方案。Kafka通过Hadoop的并行加载机制来统一了在线和离线的消息处理，这一点也是本课题所研究系统所看重的。Apache Kafka相对于ActiveMQ是一个非常轻量级的消息系统，除了性能非常好之外，还是一个工作良好的分布式系统。
        </li>
       </ul>
       <h1 id="Kafka解析">
        Kafka解析
       </h1>
       <h2 id="Terminology">
        Terminology
       </h2>
       <ul>
        <li>
         <strong>
          Broker
         </strong>
         <br/>
         Kafka集群包含一个或多个服务器，这种服务器被称为broker
        </li>
        <li>
         <strong>
          Topic
         </strong>
         <br/>
         每条发布到Kafka集群的消息都有一个类别，这个类别被称为topic。（物理上不同topic的消息分开存储，逻辑上一个topic的消息虽然保存于一个或多个broker上但用户只需指定消息的topic即可生产或消费数据而不必关心数据存于何处）
        </li>
        <li>
         <strong>
          Partition
         </strong>
         <br/>
         parition是物理上的概念，每个topic包含一个或多个partition，创建topic时可指定parition数量。每个partition对应于一个文件夹，该文件夹下存储该partition的数据和索引文件
        </li>
        <li>
         <strong>
          Producer
         </strong>
         <br/>
         负责发布消息到Kafka broker
        </li>
        <li>
         <strong>
          Consumer
         </strong>
         <br/>
         消费消息。每个consumer属于一个特定的consuer group（可为每个consumer指定group name，若不指定group name则属于默认的group）。使用consumer high level API时，同一topic的一条消息只能被同一个consumer group内的一个consumer消费，但多个consumer group可同时消费这一消息。
        </li>
       </ul>
       <h2 id="Kafka架构">
        Kafka架构
       </h2>
       <p>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/KafkaArchitecture1.png"/>
        <br/>
        如上图所示，一个典型的kafka集群中包含若干producer（可以是web前端产生的page view，或者是服务器日志，系统CPU、memory等），若干broker（Kafka支持水平扩展，一般broker数量越多，集群吞吐率越高），若干consumer group，以及一个
        <a href="http://zookeeper.apache.org/" rel="external" target="_blank">
         Zookeeper
        </a>
        集群。Kafka通过Zookeeper管理集群配置，选举leader，以及在consumer group发生变化时进行rebalance。producer使用push模式将消息发布到broker，consumer使用pull模式从broker订阅并消费消息。
       </p>
       <h3 id="Push_vs-_Pull">
        Push vs. Pull
       </h3>
       <p>
        作为一个messaging system，Kafka遵循了传统的方式，选择由producer向broker push消息并由consumer从broker pull消息。一些logging-centric system，比如Facebook的
        <a href="https://github.com/facebookarchive/scribe" rel="external" target="_blank">
         Scribe
        </a>
        和Cloudera的
        <a href="http://flume.apache.org/" rel="external" target="_blank">
         Flume
        </a>
        ,采用非常不同的push模式。事实上，push模式和pull模式各有优劣。
        <br/>
        push模式很难适应消费速率不同的消费者，因为消息发送速率是由broker决定的。push模式的目标是尽可能以最快速度传递消息，但是这样很容易造成consumer来不及处理消息，典型的表现就是拒绝服务以及网络拥塞。而pull模式则可以根据consumer的消费能力以适当的速率消费消息。
       </p>
       <h3 id="Topic_&amp;_Partition">
        Topic &amp; Partition
       </h3>
       <p>
        Topic在逻辑上可以被认为是一个在的queue，每条消费都必须指定它的topic，可以简单理解为必须指明把这条消息放进哪个queue里。为了使得Kafka的吞吐率可以水平扩展，物理上把topic分成一个或多个partition，每个partition在物理上对应一个文件夹，该文件夹下存储这个partition的所有消息和索引文件。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/topic-partition.png"/>
        <br/>
        每个日志文件都是“log entries”序列，每一个
        <code>
         log entry
        </code>
        包含一个4字节整型数（值为N），其后跟N个字节的消息体。每条消息都有一个当前partition下唯一的64字节的offset，它指明了这条消息的起始位置。磁盘上存储的消费格式如下：
        <br/>
        message length ： 4 bytes (value: 1+4+n)
        <br/>
        “magic” value ： 1 byte
        <br/>
        crc ： 4 bytes
        <br/>
        payload ： n bytes
        <br/>
        这个“log entries”并非由一个文件构成，而是分成多个segment，每个segment名为该segment第一条消息的offset和“.kafka”组成。另外会有一个索引文件，它标明了每个segment下包含的
        <code>
         log entry
        </code>
        的offset范围，如下图所示。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/partition_segment.png"/>
        <br/>
        因为每条消息都被append到该partition中，是顺序写磁盘，因此效率非常高（经验证，顺序写磁盘效率比随机写内存还要高，这是Kafka高吞吐率的一个很重要的保证）。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/partition.png"/>
        <br/>
        每一条消息被发送到broker时，会根据paritition规则选择被存储到哪一个partition。如果partition规则设置的合理，所有消息可以均匀分布到不同的partition里，这样就实现了水平扩展。（如果一个topic对应一个文件，那这个文件所在的机器I/O将会成为这个topic的性能瓶颈，而partition解决了这个问题）。在创建topic时可以在
        <code>
         $KAFKA_HOME/config/server.properties
        </code>
        中指定这个partition的数量(如下所示)，当然也可以在topic创建之后去修改parition数量。
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46a81011246859" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="comment"&gt;# The default number of log partitions per topic. More partitions allow greater&lt;/span&gt;
&lt;span class="comment"&gt;# parallelism for consumption, but this will also result in more files across&lt;/span&gt;
&lt;span class="comment"&gt;# the brokers.&lt;/span&gt;
num.&lt;span class="variable"&gt;partitions=&lt;/span&gt;&lt;span class="number"&gt;3&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46a81011246859-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a81011246859-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a81011246859-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a81011246859-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a81011246859-5">
               5
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46a81011246859-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The default number of log partitions per topic. More partitions allow greater&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a81011246859-2">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # parallelism for consumption, but this will also result in more files across&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a81011246859-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # the brokers.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a81011246859-4">
               <span class="crayon-v">
                num
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                partitions
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a81011246859-5">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0109 seconds] -->
       <p>
        在发送一条消息时，可以指定这条消息的key，producer根据这个key和partition机制来判断将这条消息发送到哪个parition。paritition机制可以通过指定producer的paritition. class这一参数来指定，该class必须实现
        <code>
         kafka.producer.Partitioner
        </code>
        接口。本例中如果key可以被解析为整数则将对应的整数与partition总数取余，该消息会被发送到该数对应的partition。（每个parition都会有个序号）
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46a93751612936" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="keyword"&gt;import&lt;/span&gt; kafka.producer.Partitioner;
&lt;span class="keyword"&gt;import&lt;/span&gt; kafka.utils.VerifiableProperties;

&lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="class"&gt;&lt;span class="keyword"&gt;class&lt;/span&gt; &lt;span class="title"&gt;JasonPartitioner&lt;/span&gt;&amp;lt;&lt;span class="title"&gt;T&lt;/span&gt;&amp;gt; &lt;span class="keyword"&gt;implements&lt;/span&gt; &lt;span class="title"&gt;Partitioner&lt;/span&gt; &lt;/span&gt;{

    &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="title"&gt;JasonPartitioner&lt;/span&gt;(VerifiableProperties verifiableProperties) {}

    &lt;span class="annotation"&gt;@Override&lt;/span&gt;
    &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;int&lt;/span&gt; &lt;span class="title"&gt;partition&lt;/span&gt;(Object key, &lt;span class="keyword"&gt;int&lt;/span&gt; numPartitions) {
        &lt;span class="keyword"&gt;try&lt;/span&gt; {
            &lt;span class="keyword"&gt;int&lt;/span&gt; partitionNum = Integer.parseInt((String) key);
            &lt;span class="keyword"&gt;return&lt;/span&gt; Math.abs(Integer.parseInt((String) key) % numPartitions);
        } &lt;span class="keyword"&gt;catch&lt;/span&gt; (Exception e) {
            &lt;span class="keyword"&gt;return&lt;/span&gt; Math.abs(key.hashCode() % numPartitions);
        }
    }
}
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a93751612936-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a93751612936-18">
               18
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46a93751612936-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                import
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                producer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                Partitioner
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-2">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                import
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                utils
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                VerifiableProperties
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-3">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-4">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-m">
                public
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "class"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "title"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                JasonPartitioner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "title"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                T
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-r">
                implements
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "title"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-e">
                Partitioner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-5">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-m">
                public
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "title"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                JasonPartitioner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-e">
                VerifiableProperties
               </span>
               <span class="crayon-v">
                verifiableProperties
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                {
               </span>
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-7">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "annotation"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                @
               </span>
               <span class="crayon-v">
                Override
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-m">
                public
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                int
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "title"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                partition
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-t">
                Object
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                int
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                numPartitions
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                try
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                int
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                partitionNum
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                Integer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                parseInt
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-t">
                String
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-12">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                return
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                Math
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                abs
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-t">
                Integer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                parseInt
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-t">
                String
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                %
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                numPartitions
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-13">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                }
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                catch
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-i">
                Exception
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                e
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-14">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                return
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                Math
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                abs
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                hashCode
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                %
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                numPartitions
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-15">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-16">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a93751612936-17">
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a93751612936-18">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0279 seconds] -->
       <p>
        如果将上例中的class作为partition.class，并通过如下代码发送20条消息（key分别为0，1，2，3）至topic2（包含4个partition）。
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46a9b771139875" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;void&lt;/span&gt; &lt;span class="title"&gt;sendMessage&lt;/span&gt;() &lt;span class="keyword"&gt;throws&lt;/span&gt; InterruptedException{
　　&lt;span class="keyword"&gt;for&lt;/span&gt;(&lt;span class="keyword"&gt;int&lt;/span&gt; i = &lt;span class="number"&gt;1&lt;/span&gt;; i &amp;lt;= &lt;span class="number"&gt;5&lt;/span&gt;; i++){
　　      List messageList = &lt;span class="keyword"&gt;new&lt;/span&gt; ArrayList&amp;lt;KeyedMessage&amp;lt;String, String&amp;gt;&amp;gt;();
　　      &lt;span class="keyword"&gt;for&lt;/span&gt;(&lt;span class="keyword"&gt;int&lt;/span&gt; j = &lt;span class="number"&gt;0&lt;/span&gt;; j &amp;lt; &lt;span class="number"&gt;4&lt;/span&gt;; j++）{
　　          messageList.add(&lt;span class="keyword"&gt;new&lt;/span&gt; KeyedMessage&amp;lt;String, String&amp;gt;(&lt;span class="string"&gt;"topic2"&lt;/span&gt;, j+&lt;span class="string"&gt;""&lt;/span&gt;, &lt;span class="string"&gt;"The "&lt;/span&gt; + i + &lt;span class="string"&gt;" message for key "&lt;/span&gt; + j));
　　      }
　　      producer.send(messageList);
    }
　　producer.close();
}
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46a9b771139875-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a9b771139875-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a9b771139875-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a9b771139875-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a9b771139875-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a9b771139875-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a9b771139875-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a9b771139875-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a9b771139875-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46a9b771139875-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46a9b771139875-11">
               11
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46a9b771139875-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-m">
                public
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                void
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "title"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                sendMessage
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-e">
                throws
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                InterruptedException
               </span>
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a9b771139875-2">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                for
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                int
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                5
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-o">
                ++
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a9b771139875-3">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                List
               </span>
               <span class="crayon-v">
                messageList
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-r">
                new
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ArrayList
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-v">
                KeyedMessage
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-t">
                String
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                String
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a9b771139875-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                for
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                int
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                j
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                j
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                j
               </span>
               <span class="crayon-o">
                ++
               </span>
               ）
               <span class="crayon-sy">
                {
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a9b771139875-5">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                messageList
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                add
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-r">
                new
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                KeyedMessage
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-t">
                String
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                String
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                "topic2"
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                j
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                ""
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                "The "
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                " message for key "
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                j
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a9b771139875-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a9b771139875-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                producer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                send
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                messageList
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a9b771139875-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a9b771139875-9">
               <span class="crayon-v">
                producer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                close
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46a9b771139875-10">
               <span class="crayon-sy">
                }
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46a9b771139875-11">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0172 seconds] -->
       <p>
        则key相同的消息会被发送并存储到同一个partition里，而且key的序号正好和partition序号相同。（partition序号从0开始，本例中的key也正好从0开始）。如下图所示。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/partition_key.png"/>
        <br/>
        对于传统的message queue而言，一般会删除已经被消费的消息，而Kafka集群会保留所有的消息，无论其被消费与否。当然，因为磁盘限制，不可能永久保留所有数据（实际上也没必要），因此Kafka提供两种策略去删除旧数据。一是基于时间，二是基于partition文件大小。例如可以通过配置
        <code>
         $KAFKA_HOME/config/server.properties
        </code>
        ，让Kafka删除一周前的数据，也可通过配置让Kafka在partition文件超过1GB时删除旧数据，如下所示。
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46aa3091715145" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Retention Policy ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# The following configurations control the disposal of log segments. The policy can&lt;/span&gt;
&lt;span class="comment"&gt;# be set to delete segments after a period of time, or after a given size has accumulated.&lt;/span&gt;
&lt;span class="comment"&gt;# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens&lt;/span&gt;
&lt;span class="comment"&gt;# from the end of the log.&lt;/span&gt;

&lt;span class="comment"&gt;# The minimum age of a log file to be eligible for deletion&lt;/span&gt;
log.retention.hours=&lt;span class="number"&gt;168&lt;/span&gt;

&lt;span class="comment"&gt;# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining&lt;/span&gt;
&lt;span class="comment"&gt;# segments don't drop below log.retention.bytes.&lt;/span&gt;
&lt;span class="comment"&gt;#log.retention.bytes=1073741824&lt;/span&gt;

&lt;span class="comment"&gt;# The maximum size of a log segment file. When this size is reached a new log segment will be created.&lt;/span&gt;
log.segment.bytes=&lt;span class="number"&gt;1073741824&lt;/span&gt;

&lt;span class="comment"&gt;# The interval at which log segments are checked to see if they can be deleted according&lt;/span&gt;
&lt;span class="comment"&gt;# to the retention policies&lt;/span&gt;
log.retention.check.interval.ms=&lt;span class="number"&gt;300000&lt;/span&gt;

&lt;span class="comment"&gt;# By default the log cleaner is disabled and the log retention policy will default to &lt;/span&gt;
&lt;span class="comment"&gt;#just delete segments after their retention expires.&lt;/span&gt;
&lt;span class="comment"&gt;# If log.cleaner.enable=true is set the cleaner will be enabled and individual logs &lt;/span&gt;
&lt;span class="comment"&gt;#can then be marked for log compaction.&lt;/span&gt;
log.cleaner.enable=&lt;span class="literal"&gt;false&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aa3091715145-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46aa3091715145-27">
               27
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Retention Policy ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-2">
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The following configurations control the disposal of log segments. The policy can&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-4">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # be set to delete segments after a period of time, or after a given size has accumulated.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-5">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # A segment will be deleted whenever *either* of these criteria are met. Deletion always happens&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-6">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # from the end of the log.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-7">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-8">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The minimum age of a log file to be eligible for deletion&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-9">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                retention
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                hours
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                168
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-10">
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-11">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # A size-based retention policy for logs. Segments are pruned from the log as long as the remaining&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-12">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # segments don't drop below log.retention.bytes.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-13">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #log.retention.bytes=1073741824&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-14">
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-15">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The maximum size of a log segment file. When this size is reached a new log segment will be created.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-16">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                segment
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                bytes
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1073741824
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-17">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-18">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The interval at which log segments are checked to see if they can be deleted according&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-19">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # to the retention policies&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-20">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                retention
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                check
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                interval
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ms
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                300000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-21">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-22">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # By default the log cleaner is disabled and the log retention policy will default to &lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-23">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #just delete segments after their retention expires.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-24">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # If log.cleaner.enable=true is set the cleaner will be enabled and individual logs &lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-25">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #can then be marked for log compaction.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aa3091715145-26">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                cleaner
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                enable
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "literal"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                false
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46aa3091715145-27">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0278 seconds] -->
       <p>
        这里要注意，因为Kafka读取特定消息的时间复杂度为O(1)，即与文件大小无关，所以这里删除文件与Kafka性能无关，选择怎样的删除策略只与磁盘以及具体的需求有关。另外，Kafka会为每一个consumer group保留一些metadata信息—当前消费的消息的position，也即offset。这个offset由consumer控制。正常情况下consumer会在消费完一条消息后线性增加这个offset。当然，consumer也可将offset设成一个较小的值，重新消费一些消息。因为offet由consumer控制，所以Kafka broker是无状态的，它不需要标记哪些消息被哪些consumer过，不需要通过broker去保证同一个consumer group只有一个consumer能消费某一条消息，因此也就不需要锁机制，这也为Kafka的高吞吐率提供了有力保障。
       </p>
       <h3 id="Replication_&amp;_Leader_election">
        Replication &amp; Leader election
       </h3>
       <p>
        Kafka从0.8开始提供partition级别的replication，replication的数量可在
        <code>
         $KAFKA_HOME/config/server.properties
        </code>
        中配置。
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46aac244428378" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="default"&gt;&lt;span class="keyword"&gt;default&lt;/span&gt;.replication.factor = 1&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46aac244428378-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46aac244428378-2">
               2
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46aac244428378-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "default"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                default
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                replication
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                factor
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46aac244428378-2">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0014 seconds] -->
       <p>
        该 Replication与leader election配合提供了自动的failover机制。replication对Kafka的吞吐率是有一定影响的，但极大的增强了可用性。默认情况下，Kafka的replication数量为1。　　每个partition都有一个唯一的leader，所有的读写操作都在leader上完成，leader批量从leader上pull数据。一般情况下partition的数量大于等于broker的数量，并且所有partition的leader均匀分布在broker上。follower上的日志和其leader上的完全一样。
        <br/>
        和大部分分布式系统一样，Kakfa处理失败需要明确定义一个broker是否alive。对于Kafka而言，Kafka存活包含两个条件，一是它必须维护与Zookeeper的session(这个通过Zookeeper的heartbeat机制来实现)。二是follower必须能够及时将leader的writing复制过来，不能“落后太多”。
        <br/>
        leader会track“in sync”的node list。如果一个follower宕机，或者落后太多，leader将把它从”in sync” list中移除。这里所描述的“落后太多”指follower复制的消息落后于leader后的条数超过预定值，该值可在
        <code>
         $KAFKA_HOME/config/server.properties
        </code>
        中配置
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46ab2186896675" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="comment"&gt;#If a replica falls more than this many messages behind the leader, the leader will remove the follower from ISR and treat it as dead&lt;/span&gt;
replica.lag.&lt;span class="built_in"&gt;max&lt;/span&gt;.messages=&lt;span class="number"&gt;4000&lt;/span&gt;

&lt;span class="comment"&gt;#If a follower hasn't sent any fetch requests for this window of time, the leader will remove the follower from ISR (in-sync replicas) and treat it as dead&lt;/span&gt;
replica.lag.&lt;span class="built_in"&gt;time&lt;/span&gt;.&lt;span class="built_in"&gt;max&lt;/span&gt;.ms=&lt;span class="number"&gt;10000&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46ab2186896675-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ab2186896675-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ab2186896675-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ab2186896675-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ab2186896675-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ab2186896675-6">
               6
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46ab2186896675-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #If a replica falls more than this many messages behind the leader, the leader will remove the follower from ISR and treat it as dead&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ab2186896675-2">
               <span class="crayon-v">
                replica
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                lag
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "built_in"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                max
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                messages
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                4000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ab2186896675-3">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ab2186896675-4">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #If a follower hasn't sent any fetch requests for this window of time, the leader will remove the follower from ISR (in-sync replicas) and treat it as dead&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ab2186896675-5">
               <span class="crayon-v">
                replica
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                lag
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "built_in"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                time
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "built_in"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                max
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ms
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ab2186896675-6">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0117 seconds] -->
       <p>
        需要说明的是，Kafka只解决”fail/recover”，不处理“Byzantine”（“拜占庭”）问题。
        <br/>
        一条消息只有被“in sync” list里的所有follower都从leader复制过去才会被认为已提交。这样就避免了部分数据被写进了leader，还没来得及被任何follower复制就宕机了，而造成数据丢失（consumer无法消费这些数据）。而对于producer而言，它可以选择是否等待消息commit，这可以通过
        <code>
         request.required.acks
        </code>
        来设置。这种机制确保了只要“in sync” list有一个或以上的flollower，一条被commit的消息就不会丢失。
        <br/>
        这里的复制机制即不是同步复制，也不是单纯的异步复制。事实上，同步复制要求“活着的”follower都复制完，这条消息才会被认为commit，这种复制方式极大的影响了吞吐率（高吞吐率是Kafka非常重要的一个特性）。而异步复制方式下，follower异步的从leader复制数据，数据只要被leader写入log就被认为已经commit，这种情况下如果follwer都落后于leader，而leader突然宕机，则会丢失数据。而Kafka的这种使用“in sync” list的方式则很好的均衡了确保数据不丢失以及吞吐率。follower可以批量的从leader复制数据，这样极大的提高复制性能（批量写磁盘），极大减少了follower与leader的差距（前文有说到，只要follower落后leader不太远，则被认为在“in sync” list里）。
       </p>
       <p>
        上文说明了Kafka是如何做replication的，另外一个很重要的问题是当leader宕机了，怎样在follower中选举出新的leader。因为follower可能落后许多或者crash了，所以必须确保选择“最新”的follower作为新的leader。一个基本的原则就是，如果leader不在了，新的leader必须拥有原来的leader commit的所有消息。这就需要作一个折衷，如果leader在标明一条消息被commit前等待更多的follower确认，那在它die之后就有更多的follower可以作为新的leader，但这也会造成吞吐率的下降。
        <br/>
        一种非常常用的选举leader的方式是“majority 灵秀”（“少数服从多数”），但Kafka并未采用这种方式。这种模式下，如果我们有2f+1个replica（包含leader和follower），那在commit之前必须保证有f+1个replica复制完消息，为了保证正确选出新的leader，fail的replica不能超过f个。因为在剩下的任意f+1个replica里，至少有一个replica包含有最新的所有消息。这种方式有个很大的优势，系统的latency只取决于最快的几台server，也就是说，如果replication factor是3，那latency就取决于最快的那个follower而非最慢那个。majority vote也有一些劣势，为了保证leader election的正常进行，它所能容忍的fail的follower个数比较少。如果要容忍1个follower挂掉，必须要有3个以上的replica，如果要容忍2个follower挂掉，必须要有5个以上的replica。也就是说，在生产环境下为了保证较高的容错程度，必须要有大量的replica，而大量的replica又会在大数据量下导致性能的急剧下降。这就是这种算法更多用在
        <a href="http://zookeeper.apache.org/" rel="external" target="_blank">
         Zookeeper
        </a>
        这种共享集群配置的系统中而很少在需要存储大量数据的系统中使用的原因。例如HDFS的HA feature是基于
        <a href="http://blog.cloudera.com/blog/2012/10/quorum-based-journaling-in-cdh4-1" rel="external" target="_blank">
         majority-vote-based journal
        </a>
        ，但是它的数据存储并没有使用这种expensive的方式。
        <br/>
        实际上，leader election算法非常多，比如Zookeper的
        <a href="http://web.stanford.edu/class/cs347/reading/zab.pdf" rel="external" target="_blank">
         Zab
        </a>
        ,
        <a href="https://ramcloud.stanford.edu/wiki/download/attachments/11370504/raft.pdf" rel="external" target="_blank">
         Raft
        </a>
        和
        <a href="http://pmg.csail.mit.edu/papers/vr-revisited.pdf" rel="external" target="_blank">
         Viewstamped Replication
        </a>
        。而Kafka所使用的leader election算法更像微软的
        <a href="http://research.microsoft.com/apps/pubs/default.aspx?id=66814" rel="external" target="_blank">
         PacificA
        </a>
        算法。
        <br/>
        Kafka在Zookeeper中动态维护了一个ISR（in-sync replicas） set，这个set里的所有replica都跟上了leader，只有ISR里的成员才有被选为leader的可能。在这种模式下，对于f+1个replica，一个Kafka topic能在保证不丢失已经ommit的消息的前提下容忍f个replica的失败。在大多数使用场景中，这种模式是非常有利的。事实上，为了容忍f个replica的失败，majority vote和ISR在commit前需要等待的replica数量是一样的，但是ISR需要的总的replica的个数几乎是majority vote的一半。
        <br/>
        虽然majority vote与ISR相比有不需等待最慢的server这一优势，但是Kafka作者认为Kafka可以通过producer选择是否被commit阻塞来改善这一问题，并且节省下来的replica和磁盘使得ISR模式仍然值得。
       </p>
       <p>
        上文提到，在ISR中至少有一个follower时，Kafka可以确保已经commit的数据不丢失，但如果某一个partition的所有replica都挂了，就无法保证数据不丢失了。这种情况下有两种可行的方案：
       </p>
       <ul>
        <li>
         等待ISR中的任一个replica“活”过来，并且选它作为leader
        </li>
        <li>
         选择第一个“活”过来的replica（不一定是ISR中的）作为leader
        </li>
       </ul>
       <p>
        这就需要在可用性和一致性当中作出一个简单的平衡。如果一定要等待ISR中的replica“活”过来，那不可用的时间就可能会相对较长。而且如果ISR中的所有replica都无法“活”过来了，或者数据都丢失了，这个partition将永远不可用。选择第一个“活”过来的replica作为leader，而这个replica不是ISR中的replica，那即使它并不保证已经包含了所有已commit的消息，它也会成为leader而作为consumer的数据源（前文有说明，所有读写都由leader完成）。Kafka0.8.*使用了第二种方式。根据Kafka的文档，在以后的版本中，Kafka支持用户通过配置选择这两种方式中的一种，从而根据不同的使用场景选择高可用性还是强一致性。
       </p>
       <p>
        上文说明了一个parition的replication过程，然尔Kafka集群需要管理成百上千个partition，Kafka通过round-robin的方式来平衡partition从而避免大量partition集中在了少数几个节点上。同时Kafka也需要平衡leader的分布，尽可能的让所有partition的leader均匀分布在不同broker上。另一方面，优化leadership election的过程也是很重要的，毕竟这段时间相应的partition处于不可用状态。一种简单的实现是暂停宕机的broker上的所有partition，并为之选举leader。实际上，Kafka选举一个broker作为controller，这个controller通过watch Zookeeper检测所有的broker failure，并负责为所有受影响的parition选举leader，再将相应的leader调整命令发送至受影响的broker，过程如下图所示。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/controller.png"/>
       </p>
       <p>
        这样做的好处是，可以批量的通知leadership的变化，从而使得选举过程成本更低，尤其对大量的partition而言。如果controller失败了，幸存的所有broker都会尝试在Zookeeper中创建/controller-&gt;{this broker id}，如果创建成功（只可能有一个创建成功），则该broker会成为controller，若创建不成功，则该broker会等待新controller的命令。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/controller_failover.png"/>
       </p>
       <h3 id="Consumer_group">
        Consumer group
       </h3>
       <p>
        （本节所有描述都是基于consumer hight level API而非low level API）。
        <br/>
        每一个consumer实例都属于一个consumer group，每一条消息只会被同一个consumer group里的一个consumer实例消费。（不同consumer group可以同时消费同一条消息）
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/consumer_group.png"/>
       </p>
       <p>
        很多传统的message queue都会在消息被消费完后将消息删除，一方面避免重复消费，另一方面可以保证queue的长度比较少，提高效率。而如上文所将，Kafka并不删除已消费的消息，为了实现传统message queue消息只被消费一次的语义，Kafka保证保证同一个consumer group里只有一个consumer会消费一条消息。与传统message queue不同的是，Kafka还允许不同consumer group同时消费同一条消息，这一特性可以为消息的多元化处理提供了支持。实际上，Kafka的设计理念之一就是同时提供离线处理和实时处理。根据这一特性，可以使用Storm这种实时流处理系统对消息进行实时在线处理，同时使用Hadoop这种批处理系统进行离线处理，还可以同时将数据实时备份到另一个数据中心，只需要保证这三个操作所使用的consumer在不同的consumer group即可。下图展示了Kafka在Linkedin的一种简化部署。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/kafka_in_linkedin.png"/>
        <br/>
        为了更清晰展示Kafka consumer group的特性，笔者作了一项测试。创建一个topic (名为topic1)，创建一个属于group1的consumer实例，并创建三个属于group2的consumer实例，然后通过producer向topic1发送key分别为1，2，3r的消息。结果发现属于group1的consumer收到了所有的这三条消息，同时group2中的3个consumer分别收到了key为1，2，3的消息。如下图所示。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/consumer_group_test.png"/>
       </p>
       <h3 id="Consumer_Rebalance">
        Consumer Rebalance
       </h3>
       <p>
        （本节所讲述内容均基于Kafka consumer high level API）
        <br/>
        Kafka保证同一consumer group中只有一个consumer会消息某条消息，实际上，Kafka保证的是稳定状态下每一个consumer实例只会消费某一个或多个特定partition的数据，而某个partition的数据只会被某一个特定的consumer实例所消费。这样设计的劣势是无法让同一个consumer group里的consumer均匀消费数据，优势是每个consumer不用都跟大量的broker通信，减少通信开销，同时也降低了分配难度，实现也更简单。另外，因为同一个partition里的数据是有序的，这种设计可以保证每个partition里的数据也是有序被消费。
        <br/>
        如果某consumer group中consumer数量少于partition数量，则至少有一个consumer会消费多个partition的数据，如果consumer的数量与partition数量相同，则正好一个consumer消费一个partition的数据，而如果consumer的数量多于partition的数量时，会有部分consumer无法消费该topic下任何一条消息。
        <br/>
        如下例所示，如果topic1有0，1，2共三个partition，当group1只有一个consumer(名为consumer1)时，该 consumer可消费这3个partition的所有数据。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer1.png"/>
        <br/>
        增加一个consumer(consumer2)后，其中一个consumer（consumer1）可消费2个partition的数据，另外一个consumer(consumer2)可消费另外一个partition的数据。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer_1_2.png"/>
        <br/>
        再增加一个consumer(consumer3)后，每个consumer可消费一个partition的数据。consumer1消费partition0，consumer2消费partition1，consumer3消费partition2
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer_1_2_3.png"/>
        <br/>
        再增加一个consumer（consumer4）后，其中3个consumer可分别消费一个partition的数据，另外一个consumer（consumer4）不能消费topic1任何数据。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer_1_2_3_4.png"/>
        <br/>
        此时关闭consumer1，剩下的consumer可分别消费一个partition的数据。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer_2_3_4.png"/>
        <br/>
        接着关闭consumer2，剩下的consumer3可消费2个partition，consumer4可消费1个partition。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer_3_4.png"/>
        <br/>
        再关闭consumer3，剩下的consumer4可同时消费topic1的3个partition。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/group1_consumer_4.png"/>
       </p>
       <p>
        consumer rebalance算法如下：
       </p>
       <ul>
        <li>
         Sort PT (all partitions in topic T)
        </li>
        <li>
         Sort CG(all consumers in consumer group G)
        </li>
        <li>
         Let i be the index position of Ci in CG and let N=size(PT)/size(CG)
        </li>
        <li>
         Remove current entries owned by Ci from the partition owner registry
        </li>
        <li>
         Assign partitions from i
         <em>
          N to (i+1)
         </em>
         N-1 to consumer Ci
        </li>
        <li>
         Add newly assigned partitions to the partition owner registry
        </li>
       </ul>
       <p>
        目前consumer rebalance的控制策略是由每一个consumer通过Zookeeper完成的。具体的控制方式如下：
       </p>
       <ul>
        <li>
         Register itself in the consumer id registry under its group.
        </li>
        <li>
         Register a watch on changes under the consumer id registry.
        </li>
        <li>
         Register a watch on changes under the broker id registry.
        </li>
        <li>
         If the consumer creates a message stream using a topic filter, it also registers a watch on changes under the broker topic registry.
        </li>
        <li>
         Force itself to rebalance within in its consumer group.
         <p>
          在这种策略下，每一个consumer或者broker的增加或者减少都会触发consumer rebalance。因为每个consumer只负责调整自己所消费的partition，为了保证整个consumer group的一致性，所以当一个consumer触发了rebalance时，该consumer group内的其它所有consumer也应该同时触发rebalance。
         </p>
        </li>
       </ul>
       <p>
        目前（2015-01-19）最新版（0.8.2）Kafka采用的是上述方式。但该方式有不利的方面：
       </p>
       <ul>
        <li>
         <b>
          Herd effect
         </b>
         <br/>
         任何broker或者consumer的增减都会触发所有的consumer的rebalance
        </li>
        <li>
         <b>
          Split Brain
         </b>
         <br/>
         每个consumer分别单独通过Zookeeper判断哪些partition down了，那么不同consumer从Zookeeper“看”到的view就可能不一样，这就会造成错误的reblance尝试。而且有可能所有的consumer都认为rebalance已经完成了，但实际上可能并非如此。
        </li>
       </ul>
       <p>
        根据Kafka官方文档，Kafka作者正在考虑在还未发布的
        <a href="https://cwiki.apache.org/confluence/display/KAFKA/Kafka+0.9+Consumer+Rewrite+Design" rel="external" target="_blank">
         0.9.x版本中使用中心协调器(coordinator)
        </a>
        。大体思想是选举出一个broker作为coordinator，由它watch Zookeeper，从而判断是否有partition或者consumer的增减，然后生成rebalance命令，并检查是否这些rebalance在所有相关的consumer中被执行成功，如果不成功则重试，若成功则认为此次rebalance成功（这个过程跟replication controller非常类似，所以我很奇怪为什么当初设计replication controller时没有使用类似方式来解决consumer rebalance的问题）。流程如下：
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/coordinator.png"/>
       </p>
       <h3 id="消息Deliver_guarantee">
        消息Deliver guarantee
       </h3>
       <p>
        通过上文介绍，想必读者已经明天了producer和consumer是如何工作的，以及Kafka是如何做replication的，接下来要讨论的是Kafka如何确保消息在producer和consumer之间传输。有这么几种可能的delivery guarantee：
       </p>
       <ul>
        <li>
         <code>
          At most once
         </code>
         消息可能会丢，但绝不会重复传输
        </li>
        <li>
         <code>
          At least one
         </code>
         消息绝不会丢，但可能会重复传输
        </li>
        <li>
         <code>
          Exactly once
         </code>
         每条消息肯定会被传输一次且仅传输一次，很多时候这是用户所想要的。
         <p>
          Kafka的delivery guarantee semantic非常直接。当producer向broker发送消息时，一旦这条消息被commit，因数replication的存在，它就不会丢。但是如果producer发送数据给broker后，遇到的网络问题而造成通信中断，那producer就无法判断该条消息是否已经commit。这一点有点像向一个自动生成primary key的数据库表中插入数据。虽然Kafka无法确定网络故障期间发生了什么，但是producer可以生成一种类似于primary key的东西，发生故障时幂等性的retry多次，这样就做到了
          <code>
           Exactly one
          </code>
          。截止到目前(Kafka 0.8.2版本，2015-01-25)，这一feature还并未实现，有希望在Kafka未来的版本中实现。（所以目前默认情况下一条消息从producer和broker是确保了
          <code>
           At least once
          </code>
          ，但可通过设置producer异步发送实现
          <code>
           At most once
          </code>
          ）。
          <br/>
          接下来讨论的是消息从broker到consumer的delivery guarantee semantic。（仅针对Kafka consumer high level API）。consumer在从broker读取消息后，可以选择commit，该操作会在Zookeeper中存下该consumer在该partition下读取的消息的offset。该consumer下一次再读该partition时会从下一条开始读取。如未commit，下一次读取的开始位置会跟上一次commit之后的开始位置相同。当然可以将consumer设置为autocommit，即consumer一旦读到数据立即自动commit。如果只讨论这一读取消息的过程，那Kafka是确保了
          <code>
           Exactly once
          </code>
          。但实际上实际使用中consumer并非读取完数据就结束了，而是要进行进一步处理，而数据处理与commit的顺序在很大程度上决定了消息从broker和consumer的delivery guarantee semantic。
         </p>
        </li>
        <li>
         读完消息先commit再处理消息。这种模式下，如果consumer在commit后还没来得及处理消息就crash了，下次重新开始工作后就无法读到刚刚已提交而未处理的消息，这就对应于
         <code>
          At most once
         </code>
        </li>
        <li>
         读完消息先处理再commit。这种模式下，如果处理完了消息在commit之前consumer crash了，下次重新开始工作时还会处理刚刚未commit的消息，实际上该消息已经被处理过了。这就对应于
         <code>
          At least once
         </code>
         。在很多情况使用场景下，消息都有一个primary key，所以消息的处理往往具有幂等性，即多次处理这一条消息跟只处理一次是等效的，那就可以认为是
         <code>
          Exactly once
         </code>
         。（人个感觉这种说法有些牵强，毕竟它不是Kafka本身提供的机制，而且primary key本身不保证操作的幂等性。而且实际上我们说delivery guarantee semantic是讨论被处理多少次，而非处理结果怎样，因为处理方式多种多样，我们的系统不应该把处理过程的特性—如是否幂等性，当成Kafka本身的feature）
        </li>
        <li>
         如果一定要做到
         <code>
          Exactly once
         </code>
         ，就需要协调offset和实际操作的输出。精典的做法是引入两阶段提交。如果能让offset和操作输入存在同一个地方，会更简洁和通用。这种方式可能更好，因为许多输出系统可能不支持两阶段提交。比如，consumer拿到数据后可能把数据放到HDFS，如果把最新的offset和数据本身一起写到HDFS，那就可以保证数据的输出和offset的更新要么都完成，要么都不完成，间接实现
         <code>
          Exactly once
         </code>
         。（目前就high level API而言，offset是存于Zookeeper中的，无法存于HDFS，而low level API的offset是由自己去维护的，可以将之存于HDFS中）
         <br/>
         总之，Kafka默认保证
         <code>
          At least once
         </code>
         ，并且允许通过设置producer异步提交来实现
         <code>
          At most once
         </code>
         。而
         <code>
          Exactly once
         </code>
         要求与目标存储系统协作，幸运的是Kafka提供的offset可以使用这种方式非常直接非常容易。
        </li>
       </ul>
       <h1 id="Benchmark">
        Benchmark
       </h1>
       <p>
        纸上得来终觉浅，绝知些事要躬行。笔者希望能亲自测一下Kafka的性能，而非从网上找一些测试数据。所以笔者曾在0.8发布前两个月做过详细的Kafka0.8性能测试，不过很可惜测试报告不慎丢失。所幸在网上找到了Kafka的创始人之一的
        <a href="http://engineering.linkedin.com/kafka/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines" rel="external" target="_blank">
         Jay Kreps的bechmark
        </a>
        。以下描述皆基于该benchmark。（该benchmark基于Kafka0.8.1）
       </p>
       <h2 id="测试环境">
        测试环境
       </h2>
       <p>
        该benchmark用到了六台机器，机器配置如下
       </p>
       <ul>
        <li>
         Intel Xeon 2.5 GHz processor with six cores
        </li>
        <li>
         Six 7200 RPM SATA drives
        </li>
        <li>
         32GB of RAM
        </li>
        <li>
         1Gb Ethernet
         <p>
          这6台机器其中3台用来搭建Kafka broker集群，另外3台用来安装Zookeeper及生成测试数据。6个drive都直接以非RAID方式挂载。实际上kafka对机器的需求与Hadoop的类似。
         </p>
        </li>
       </ul>
       <h2 id="producer吞吐率">
        producer吞吐率
       </h2>
       <p>
        该项测试只测producer的吞吐率，也就是数据只被持久化，没有consumer读数据。
       </p>
       <h3 id="1个producer线程，无replication">
        1个producer线程，无replication
       </h3>
       <p>
        在这一测试中，创建了一个包含6个partition且没有replication的topic。然后通过一个线程尽可能快的生成50 million条比较短（payload100字节长）的消息。测试结果是
        <strong>
         <em>
          821,557 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          78.3MB/second
         </em>
        </strong>
        ）。
        <br/>
        之所以使用短消息，是因为对于消息系统来说这种使用场景更难。因为如果使用MB/second来表征吞吐率，那发送长消息无疑能使得测试结果更好。
        <br/>
        整个测试中，都是用每秒钟delivery的消息的数量乘以payload的长度来计算MB/second的，没有把消息的元信息算在内，所以实际的网络使用量会比这个大。对于本测试来说，每次还需传输额外的22个字节，包括一个可选的key，消息长度描述，CRC等。另外，还包含一些请求相关的overhead，比如topic，partition，acknowledgement等。这就导致我们比较难判断是否已经达到网卡极限，但是把这些overhead都算在吞吐率里面应该更合理一些。因此，我们已经基本达到了网卡的极限。
        <br/>
        初步观察此结果会认为它比人们所预期的要高很多，尤其当考虑到Kafka要把数据持久化到磁盘当中。实际上，如果使用随机访问数据系统，比如RDBMS，或者key-velue store，可预期的最高访问频率大概是5000到50000个请求每秒，这和一个好的RPC层所能接受的远程请求量差不多。而该测试中远超于此的原因有两个。
       </p>
       <ul>
        <li>
         Kafka确保写磁盘的过程是线性磁盘I/O，测试中使用的6块廉价磁盘线性I/O的最大吞吐量是822MB/second，这已经远大于1Gb网卡所能带来的吞吐量了。许多消息系统把数据持久化到磁盘当成是一个开销很大的事情，这是因为他们对磁盘的操作都不是线性I/O。
        </li>
        <li>
         在每一个阶段，Kafka都尽量使用批量处理。如果想了解批处理在I/O操作中的重要性，可以参考David Patterson的”
         <a href="http://www.ll.mit.edu/HPEC/agendas/proc04/invited/patterson_keynote.pdf" rel="external" target="_blank">
          Latency Lags Bandwidth
         </a>
         “
        </li>
       </ul>
       <h3 id="1个producer线程，3个异步replication">
        1个producer线程，3个异步replication
       </h3>
       <p>
        该项测试与上一测试基本一样，唯一的区别是每个partition有3个replica（所以网络传输的和写入磁盘的总的数据量增加了3倍）。每一个broker即要写作为leader的partition，也要读（从leader读数据）写（将数据写到磁盘）作为follower的partition。测试结果为
        <strong>
         <em>
          786,980 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          75.1MB/second
         </em>
        </strong>
        ）。
        <br/>
        该项测试中replication是异步的，也就是说broker收到数据并写入本地磁盘后就acknowledge producer，而不必等所有replica都完成replication。也就是说，如果leader crash了，可能会丢掉一些最新的还未备份的数据。但这也会让message acknowledgement延迟更少，实时性更好。
        <br/>
        这项测试说明，replication可以很快。整个集群的写能力可能会由于3倍的replication而只有原来的三分之一，但是对于每一个producer来说吞吐率依然足够好。
       </p>
       <h3 id="1个producer线程，3个同步replication">
        1个producer线程，3个同步replication
       </h3>
       <p>
        该项测试与上一测试的唯一区别是replication是同步的，每条消息只有在被
        <code>
         in sync
        </code>
        集合里的所有replica都复制过去后才会被置为committed（此时broker会向producer发送acknowledgement）。在这种模式下，Kafka可以保证即使leader crash了，也不会有数据丢失。测试结果为
        <strong>
         <em>
          421,823 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          40.2MB/second
         </em>
        </strong>
        ）。
        <br/>
        Kafka同步复制与异步复制并没有本质的不同。leader会始终track follower replica从而监控它们是否还alive，只有所有
        <code>
         in sync
        </code>
        集合里的replica都acknowledge的消息才可能被consumer所消费。而对follower的等待影响了吞吐率。可以通过增大batch size来改善这种情况，但为了避免特定的优化而影响测试结果的可比性，本次测试并没有做这种调整。
       </p>
       <h3 id="3个producer,3个异步replication">
        3个producer,3个异步replication
       </h3>
       <p>
        该测试相当于把上文中的1个producer,复制到了3台不同的机器上（在1台机器上跑多个实例对吞吐率的增加不会有太大帮忙，因为网卡已经基本饱和了），这3个producer同时发送数据。整个集群的吞吐率为
        <strong>
         <em>
          2,024,032 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          193,0MB/second
         </em>
        </strong>
        ）。
       </p>
       <h2 id="Producer_Throughput_Vs-_Stored_Data">
        Producer Throughput Vs. Stored Data
       </h2>
       <p>
        消息系统的一个潜在的危险是当数据能都存于内存时性能很好，但当数据量太大无法完全存于内存中时（然后很多消息系统都会删除已经被消费的数据，但当消费速度比生产速度慢时，仍会造成数据的堆积），数据会被转移到磁盘，从而使得吞吐率下降，这又反过来造成系统无法及时接收数据。这样就非常糟糕，而实际上很多情景下使用queue的目的就是解决数据消费速度和生产速度不一致的问题。
        <br/>
        但Kafka不存在这一问题，因为Kafka始终以O（1）的时间复杂度将数据持久化到磁盘，所以其吞吐率不受磁盘上所存储的数据量的影响。为了验证这一特性，做了一个长时间的大数据量的测试，下图是吞吐率与数据量大小的关系图。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/throughput_size.png"/>
        <br/>
        上图中有一些variance的存在，并可以明显看到，吞吐率并不受磁盘上所存数据量大小的影响。实际上从上图可以看到，当磁盘数据量达到1TB时，吞吐率和磁盘数据只有几百MB时没有明显区别。
        <br/>
        这个variance是由Linux I/O管理造成的，它会把数据缓存起来再批量flush。上图的测试结果是在生产环境中对Kafka集群做了些tuning后得到的，这些tuning方法可参考
        <a href="http://kafka.apache.org/documentation.html#hwandos" rel="external" target="_blank">
         这里
        </a>
        。
       </p>
       <h2 id="consumer吞吐率">
        consumer吞吐率
       </h2>
       <p>
        需要注意的是，replication factor并不会影响consumer的吞吐率测试，因为consumer只会从每个partition的leader读数据，而与replicaiton factor无关。同样，consumer吞吐率也与同步复制还是异步复制无关。
       </p>
       <h3 id="1个consumer">
        1个consumer
       </h3>
       <p>
        该测试从有6个partition，3个replication的topic消费50 million的消息。测试结果为
        <strong>
         <em>
          940,521 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          89.7MB/second
         </em>
        </strong>
        ）。
        <br/>
        可以看到，Kafkar的consumer是非常高效的。它直接从broker的文件系统里读取文件块。Kafka使用
        <a href="http://www.ibm.com/developerworks/library/j-zerocopy/" rel="external" target="_blank">
         sendfile API
        </a>
        来直接通过操作系统直接传输，而不用把数据拷贝到用户空间。该项测试实际上从log的起始处开始读数据，所以它做了真实的I/O。在生产环境下，consumer可以直接读取producer刚刚写下的数据（它可能还在缓存中）。实际上，如果在生产环境下跑
        <a href="http://en.wikipedia.org/wiki/Iostat" rel="external" target="_blank">
         I/O stat
        </a>
        ，你可以看到基本上没有物理“读”。也就是说生产环境下consumer的吞吐率会比该项测试中的要高。
       </p>
       <h3 id="3个consumer">
        3个consumer
       </h3>
       <p>
        将上面的consumer复制到3台不同的机器上，并且并行运行它们（从同一个topic上消费数据）。测试结果为
        <strong>
         <em>
          2,615,968 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          249.5MB/second
         </em>
        </strong>
        ）。
        <br/>
        正如所预期的那样，consumer的吞吐率几乎线性增涨。
       </p>
       <h2 id="Producer_and_Consumer">
        Producer and Consumer
       </h2>
       <p>
        上面的测试只是把producer和consumer分开测试，而该项测试同时运行producer和consumer，这更接近使用场景。实际上目前的replication系统中follower就相当于consumer在工作。
        <br/>
        该项测试，在具有6个partition和3个replica的topic上同时使用1个producer和1个consumer，并且使用异步复制。测试结果为
        <strong>
         <em>
          795,064 records/second
         </em>
        </strong>
        （
        <strong>
         <em>
          75.8MB/second
         </em>
        </strong>
        ）。
        <br/>
        可以看到，该项测试结果与单独测试1个producer时的结果几乎一致。所以说consumer非常轻量级。
       </p>
       <h2 id="消息长度对吞吐率的影响">
        消息长度对吞吐率的影响
       </h2>
       <p>
        上面的所有测试都基于短消息（payload 100字节），而正如上文所说，短消息对Kafka来说是更难处理的使用方式，可以预期，随着消息长度的增大，records/second会减小，但MB/second会有所提高。下图是records/second与消息长度的关系图。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/record_size_throughput.png"/>
        <br/>
        正如我们所预期的那样，随着消息长度的增加，每秒钟所能发送的消息的数量逐渐减小。但是如果看每秒钟发送的消息的总大小，它会随着消息长度的增加而增加，如下图所示。
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/01/records_MB.png"/>
        <br/>
        从上图可以看出，当消息长度为10字节时，因为要频繁入队，花了太多时间获取锁，CPU成了瓶颈，并不能充分利用带宽。但从100字节开始，我们可以看到带宽的使用逐渐趋于饱和（虽然MB/second还是会随着消息长度的增加而增加，但增加的幅度也越来越小）。
       </p>
       <h2 id="端到端的Latency">
        端到端的Latency
       </h2>
       <p>
        上文中讨论了吞吐率，那消息传输的latency如何呢？也就是说消息从producer到consumer需要多少时间呢？该项测试创建1个producer和1个consumer并反复计时。结果是，
        <strong>
         <em>
          2 ms (median), 3ms (99th percentile, 14ms (99.9th percentile)
         </em>
        </strong>
        。
        <br/>
        （这里并没有说明topic有多少个partition，也没有说明有多少个replica，replication是同步还是异步。实际上这会极大影响producer发送的消息被commit的latency，而只有committed的消息才能被consumer所消费，所以它会最终影响端到端的latency）
       </p>
       <h2 id="重现该benchmark">
        重现该benchmark
       </h2>
       <p>
        如果读者想要在自己的机器上重现本次benchmark测试，可以参考
        <a href="https://gist.github.com/jkreps/c7ddb4041ef62a900e6c" rel="external" target="_blank">
         本次测试的配置和所使用的命令
        </a>
        。
        <br/>
        实际上Kafka Distribution提供了producer性能测试工具，可通过
        <code>
         bin/kafka-producer-perf-test.sh
        </code>
        脚本来启动。所使用的命令如下
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46ad6914280246" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; --create --topic test-rep-one --partitions &lt;span class="number"&gt;6&lt;/span&gt; --replication-factor &lt;span class="number"&gt;1&lt;/span&gt;
bin/kafka-topics.sh --zookeeper esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; --create --topic test --partitions &lt;span class="number"&gt;6&lt;/span&gt; --replication-factor &lt;span class="number"&gt;3&lt;/span&gt;

Single thread, no replication

bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 &lt;span class="number"&gt;50000000&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;8196&lt;/span&gt;

Single-thread, async &lt;span class="number"&gt;3&lt;/span&gt;x replication

bin/kafktopics.sh --zookeeper esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; --create --topic test --partitions &lt;span class="number"&gt;6&lt;/span&gt; --replication-factor &lt;span class="number"&gt;3&lt;/span&gt;
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test6 &lt;span class="number"&gt;50000000&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;8196&lt;/span&gt;

Single-thread, sync &lt;span class="number"&gt;3&lt;/span&gt;x replication

bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test &lt;span class="number"&gt;50000000&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=-&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;64000&lt;/span&gt;

Three Producers, &lt;span class="number"&gt;3&lt;/span&gt;x async replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test &lt;span class="number"&gt;50000000&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;8196&lt;/span&gt;

Throughput Versus Stored Data

bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test &lt;span class="number"&gt;50000000000&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;8196&lt;/span&gt;

Effect of message &lt;span class="keyword"&gt;size&lt;/span&gt;

&lt;span class="keyword"&gt;for&lt;/span&gt; i &lt;span class="keyword"&gt;in&lt;/span&gt; &lt;span class="number"&gt;10&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; &lt;span class="number"&gt;1000&lt;/span&gt; &lt;span class="number"&gt;10000&lt;/span&gt; &lt;span class="number"&gt;100000&lt;/span&gt;;
&lt;span class="keyword"&gt;do&lt;/span&gt;
echo &lt;span class="string"&gt;""&lt;/span&gt;
echo &lt;span class="variable"&gt;$i&lt;/span&gt;
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test &lt;span class="variable"&gt;$(&lt;/span&gt;(&lt;span class="number"&gt;1000&lt;/span&gt;&lt;span class="variable"&gt;*1024&lt;/span&gt;&lt;span class="variable"&gt;*1024&lt;/span&gt;/&lt;span class="variable"&gt;$i&lt;/span&gt;)) &lt;span class="variable"&gt;$i&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;128000&lt;/span&gt;
done;

Consumer
Consumer throughput

bin/kafka-consumer-perf-test.sh --zookeeper esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; --messages &lt;span class="number"&gt;50000000&lt;/span&gt; --topic test --threads &lt;span class="number"&gt;1&lt;/span&gt;

&lt;span class="number"&gt;3&lt;/span&gt; Consumers

On three servers, run:
bin/kafka-consumer-perf-test.sh --zookeeper esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; --messages &lt;span class="number"&gt;50000000&lt;/span&gt; --topic test --threads &lt;span class="number"&gt;1&lt;/span&gt;

End-to-end Latency

bin/kafka-run-class.sh kafka.tools.TestEndToEndLatency esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; test &lt;span class="number"&gt;5000&lt;/span&gt;

Producer and consumer

bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test &lt;span class="number"&gt;50000000&lt;/span&gt; &lt;span class="number"&gt;100&lt;/span&gt; -&lt;span class="number"&gt;1&lt;/span&gt; acks=&lt;span class="number"&gt;1&lt;/span&gt; bootstrap.servers=esv4-hcl198.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;9092&lt;/span&gt; buffer.&lt;span class="keyword"&gt;memory&lt;/span&gt;=&lt;span class="number"&gt;67108864&lt;/span&gt; batch.&lt;span class="keyword"&gt;size&lt;/span&gt;=&lt;span class="number"&gt;8196&lt;/span&gt;

bin/kafka-consumer-perf-test.sh --zookeeper esv4-hcl197.&lt;span class="keyword"&gt;grid&lt;/span&gt;.linkedin.com:&lt;span class="number"&gt;2181&lt;/span&gt; --messages &lt;span class="number"&gt;50000000&lt;/span&gt; --topic test --threads &lt;span class="number"&gt;1&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-27">
               27
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-28">
               28
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-29">
               29
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-30">
               30
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-31">
               31
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-32">
               32
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-33">
               33
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-34">
               34
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-35">
               35
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-36">
               36
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-37">
               37
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-38">
               38
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-39">
               39
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-40">
               40
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-41">
               41
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-42">
               42
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-43">
               43
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-44">
               44
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-45">
               45
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-46">
               46
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-47">
               47
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-48">
               48
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-49">
               49
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-50">
               50
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-51">
               51
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-52">
               52
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ad6914280246-53">
               53
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ad6914280246-54">
               54
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-1">
               <span class="crayon-e">
                Producer
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-2">
               <span class="crayon-e">
                Setup
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-3">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                topics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sh
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                zookeeper
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                create
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                topic
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                rep
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                one
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                partitions
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                6
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                replication
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                factor
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-4">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                topics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sh
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                zookeeper
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                create
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                topic
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                partitions
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                6
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                replication
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                factor
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-5">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-6">
               <span class="crayon-e">
                Single
               </span>
               <span class="crayon-v">
                thread
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                no
               </span>
               <span class="crayon-e">
                replication
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-7">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-8">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test7
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8196
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-9">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-10">
               <span class="crayon-v">
                Single
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                thread
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                async
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-i">
                x
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                replication
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-11">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-12">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafktopics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sh
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                zookeeper
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                create
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                topic
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                partitions
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                6
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                replication
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                factor
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-13">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test6
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8196
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-14">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-15">
               <span class="crayon-v">
                Single
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                thread
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sync
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-i">
                x
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                replication
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-16">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-17">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                64000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-18">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-19">
               <span class="crayon-e">
                Three
               </span>
               <span class="crayon-v">
                Producers
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-i">
                x
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                async
               </span>
               <span class="crayon-e">
                replication
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-20">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8196
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-21">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-22">
               <span class="crayon-e">
                Throughput
               </span>
               <span class="crayon-e">
                Versus
               </span>
               <span class="crayon-e">
                Stored
               </span>
               <span class="crayon-e">
                Data
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-23">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-24">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8196
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-25">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-26">
               <span class="crayon-e">
                Effect
               </span>
               <span class="crayon-e">
                of
               </span>
               <span class="crayon-v">
                message
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-27">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-28">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                for
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-29">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                do
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-30">
               <span class="crayon-v">
                echo
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                ""
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-31">
               <span class="crayon-v">
                echo
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                $
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-32">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                $
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-cn">
                1024
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-cn">
                1024
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                $
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "variable"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                $
               </span>
               <span class="crayon-v">
                i
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                128000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-33">
               <span class="crayon-v">
                done
               </span>
               <span class="crayon-sy">
                ;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-34">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-35">
               <span class="crayon-e">
                Consumer
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-36">
               <span class="crayon-e">
                Consumer
               </span>
               <span class="crayon-e">
                throughput
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-37">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-38">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                consumer
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                perf
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sh
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                zookeeper
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                messages
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                topic
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                threads
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-39">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-40">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Consumers
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-41">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-42">
               <span class="crayon-e">
                On
               </span>
               <span class="crayon-e">
                three
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                :
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-43">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                consumer
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                perf
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sh
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                zookeeper
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                messages
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                topic
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                threads
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-44">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-45">
               <span class="crayon-st">
                End
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-st">
                to
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-st">
                end
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Latency
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-46">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-47">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                TestEndToEndLatency
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                5000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-48">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-49">
               <span class="crayon-e">
                Producer
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                consumer
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-50">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-51">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                run
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                sh
               </span>
               <span class="crayon-v">
                org
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                apache
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                clients
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                tools
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                ProducerPerformance
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                100
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                acks
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bootstrap
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                servers
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl198
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                memory
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                67108864
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                batch
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                size
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;=
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8196
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-52">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ad6914280246-53">
               <span class="crayon-v">
                bin
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                consumer
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                perf
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sh
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                zookeeper
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                messages
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                50000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-e">
                topic
               </span>
               <span class="crayon-v">
                test
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-v">
                threads
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ad6914280246-54">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.2499 seconds] -->
       <p>
        broker配置如下
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576864eb46ae4139259772" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Server Basics ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# The id of the broker. This must be set to a unique integer for each broker.&lt;/span&gt;
broker.id=&lt;span class="number"&gt;0&lt;/span&gt;

&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Socket Server Settings ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# The port the socket server listens on&lt;/span&gt;
port=&lt;span class="number"&gt;9092&lt;/span&gt;

&lt;span class="comment"&gt;# Hostname the broker will bind to and advertise to producers and consumers.&lt;/span&gt;
&lt;span class="comment"&gt;# If not set, the server will bind to all interfaces and advertise the value returned from&lt;/span&gt;
&lt;span class="comment"&gt;# from java.net.InetAddress.getCanonicalHostName().&lt;/span&gt;
&lt;span class="comment"&gt;#host.name=localhost&lt;/span&gt;

&lt;span class="comment"&gt;# The number of threads handling network requests&lt;/span&gt;
num.network.threads=&lt;span class="number"&gt;4&lt;/span&gt;

&lt;span class="comment"&gt;# The number of threads doing disk I/O&lt;/span&gt;
num.io.threads=&lt;span class="number"&gt;8&lt;/span&gt;

&lt;span class="comment"&gt;# The send buffer (SO_SNDBUF) used by the socket server&lt;/span&gt;
socket.send.buffer.bytes=&lt;span class="number"&gt;1048576&lt;/span&gt;

&lt;span class="comment"&gt;# The receive buffer (SO_RCVBUF) used by the socket server&lt;/span&gt;
socket.receive.buffer.bytes=&lt;span class="number"&gt;1048576&lt;/span&gt;

&lt;span class="comment"&gt;# The maximum size of a request that the socket server will accept (protection against OOM)&lt;/span&gt;
socket.request.max.bytes=&lt;span class="number"&gt;104857600&lt;/span&gt;


&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Basics ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# The directory under which to store log files&lt;/span&gt;
log.dirs=/grid/a/dfs-data/kafka-logs,/grid/b/dfs-data/kafka-logs,/grid/c/dfs-data/kafka-logs,/grid/d/dfs-data/kafka-logs,/grid/e/dfs-data/kafka-logs,/grid/f/dfs-data/kafka-logs

&lt;span class="comment"&gt;# The number of logical partitions per topic per server. More partitions allow greater parallelism&lt;/span&gt;
&lt;span class="comment"&gt;# for consumption, but also mean more files.&lt;/span&gt;
num.partitions=&lt;span class="number"&gt;8&lt;/span&gt;

&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Flush Policy ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# The following configurations control the flush of data to disk. This is the most&lt;/span&gt;
&lt;span class="comment"&gt;# important performance knob in kafka.&lt;/span&gt;
&lt;span class="comment"&gt;# There are a few important trade-offs here:&lt;/span&gt;
&lt;span class="comment"&gt;#    1. Durability: Unflushed data is at greater risk of loss in the event of a crash.&lt;/span&gt;
&lt;span class="comment"&gt;#    2. Latency: Data is not made available to consumers until it is flushed (which adds latency).&lt;/span&gt;
&lt;span class="comment"&gt;#    3. Throughput: The flush is generally the most expensive operation. &lt;/span&gt;
&lt;span class="comment"&gt;# The settings below allow one to configure the flush policy to flush data after a period of time or&lt;/span&gt;
&lt;span class="comment"&gt;# every N messages (or both). This can be done globally and overridden on a per-topic basis.&lt;/span&gt;

&lt;span class="comment"&gt;# Per-topic overrides for log.flush.interval.ms&lt;/span&gt;
&lt;span class="comment"&gt;#log.flush.intervals.ms.per.topic=topic1:1000, topic2:3000&lt;/span&gt;

&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Retention Policy ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# The following configurations control the disposal of log segments. The policy can&lt;/span&gt;
&lt;span class="comment"&gt;# be set to delete segments after a period of time, or after a given size has accumulated.&lt;/span&gt;
&lt;span class="comment"&gt;# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens&lt;/span&gt;
&lt;span class="comment"&gt;# from the end of the log.&lt;/span&gt;

&lt;span class="comment"&gt;# The minimum age of a log file to be eligible for deletion&lt;/span&gt;
log.retention.hours=&lt;span class="number"&gt;168&lt;/span&gt;

&lt;span class="comment"&gt;# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining&lt;/span&gt;
&lt;span class="comment"&gt;# segments don't drop below log.retention.bytes.&lt;/span&gt;
&lt;span class="comment"&gt;#log.retention.bytes=1073741824&lt;/span&gt;

&lt;span class="comment"&gt;# The maximum size of a log segment file. When this size is reached a new log segment will be created.&lt;/span&gt;
log.segment.bytes=&lt;span class="number"&gt;536870912&lt;/span&gt;

&lt;span class="comment"&gt;# The interval at which log segments are checked to see if they can be deleted according &lt;/span&gt;
&lt;span class="comment"&gt;# to the retention policies&lt;/span&gt;
log.cleanup.interval.mins=&lt;span class="number"&gt;1&lt;/span&gt;

&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Zookeeper ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;

&lt;span class="comment"&gt;# Zookeeper connection string (see zookeeper docs for details).&lt;/span&gt;
&lt;span class="comment"&gt;# This is a comma separated host:port pairs, each corresponding to a zk&lt;/span&gt;
&lt;span class="comment"&gt;# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".&lt;/span&gt;
&lt;span class="comment"&gt;# You can also append an optional chroot string to the urls to specify the&lt;/span&gt;
&lt;span class="comment"&gt;# root directory for all kafka znodes.&lt;/span&gt;
zookeeper.connect=esv4-hcl197.grid.linkedin.&lt;span class="attribute"&gt;com&lt;/span&gt;:&lt;span class="number"&gt;2181&lt;/span&gt;

&lt;span class="comment"&gt;# Timeout in ms for connecting to zookeeper&lt;/span&gt;
zookeeper.connection.timeout.ms=&lt;span class="number"&gt;1000000&lt;/span&gt;

&lt;span class="comment"&gt;# metrics reporter properties&lt;/span&gt;
kafka.metrics.polling.interval.secs=&lt;span class="number"&gt;5&lt;/span&gt;
kafka.metrics.reporters=kafka.metrics.KafkaCSVMetricsReporter
kafka.csv.metrics.dir=/tmp/kafka_metrics
&lt;span class="comment"&gt;# Disable csv reporting by default.&lt;/span&gt;
kafka.csv.metrics.reporter.enabled=&lt;span class="literal"&gt;false&lt;/span&gt;

replica.lag.max.messages=&lt;span class="number"&gt;10000000&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-27">
               27
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-28">
               28
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-29">
               29
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-30">
               30
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-31">
               31
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-32">
               32
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-33">
               33
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-34">
               34
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-35">
               35
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-36">
               36
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-37">
               37
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-38">
               38
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-39">
               39
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-40">
               40
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-41">
               41
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-42">
               42
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-43">
               43
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-44">
               44
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-45">
               45
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-46">
               46
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-47">
               47
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-48">
               48
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-49">
               49
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-50">
               50
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-51">
               51
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-52">
               52
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-53">
               53
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-54">
               54
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-55">
               55
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-56">
               56
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-57">
               57
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-58">
               58
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-59">
               59
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-60">
               60
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-61">
               61
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-62">
               62
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-63">
               63
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-64">
               64
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-65">
               65
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-66">
               66
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-67">
               67
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-68">
               68
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-69">
               69
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-70">
               70
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-71">
               71
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-72">
               72
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-73">
               73
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-74">
               74
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-75">
               75
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-76">
               76
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-77">
               77
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-78">
               78
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-79">
               79
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-80">
               80
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-81">
               81
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-82">
               82
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-83">
               83
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-84">
               84
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-85">
               85
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-86">
               86
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-87">
               87
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-88">
               88
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-89">
               89
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-90">
               90
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-91">
               91
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-92">
               92
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-93">
               93
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-94">
               94
              </div>
              <div class="crayon-num" data-line="crayon-576864eb46ae4139259772-95">
               95
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576864eb46ae4139259772-96">
               96
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Server Basics ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-2">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The id of the broker. This must be set to a unique integer for each broker.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-4">
               <span class="crayon-v">
                broker
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-5">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-6">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Socket Server Settings ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-7">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-8">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The port the socket server listens on&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-9">
               <span class="crayon-v">
                port
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                9092
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-10">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-11">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # Hostname the broker will bind to and advertise to producers and consumers.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-12">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # If not set, the server will bind to all interfaces and advertise the value returned from&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-13">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # from java.net.InetAddress.getCanonicalHostName().&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-14">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #host.name=localhost&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-15">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-16">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The number of threads handling network requests&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-17">
               <span class="crayon-v">
                num
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                network
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                threads
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-18">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-19">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The number of threads doing disk I/O&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-20">
               <span class="crayon-v">
                num
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                io
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                threads
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-21">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-22">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The send buffer (SO_SNDBUF) used by the socket server&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-23">
               <span class="crayon-v">
                socket
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                send
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                bytes
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1048576
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-24">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-25">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The receive buffer (SO_RCVBUF) used by the socket server&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-26">
               <span class="crayon-v">
                socket
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                receive
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                bytes
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1048576
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-27">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-28">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The maximum size of a request that the socket server will accept (protection against OOM)&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-29">
               <span class="crayon-v">
                socket
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                request
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                max
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                bytes
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                104857600
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-30">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-31">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-32">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Basics ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-33">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-34">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The directory under which to store log files&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-35">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                dirs
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                a
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                dfs
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                data
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                logs
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                b
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                dfs
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                data
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                logs
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                dfs
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                data
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                logs
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                d
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                dfs
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                data
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                logs
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                e
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                dfs
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                data
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                logs
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                f
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                dfs
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                data
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                logs
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-36">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-37">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The number of logical partitions per topic per server. More partitions allow greater parallelism&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-38">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # for consumption, but also mean more files.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-39">
               <span class="crayon-v">
                num
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                partitions
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                8
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-40">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-41">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Flush Policy ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-42">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-43">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The following configurations control the flush of data to disk. This is the most&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-44">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # important performance knob in kafka.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-45">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # There are a few important trade-offs here:&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-46">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #    1. Durability: Unflushed data is at greater risk of loss in the event of a crash.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-47">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #    2. Latency: Data is not made available to consumers until it is flushed (which adds latency).&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-48">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #    3. Throughput: The flush is generally the most expensive operation. &lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-49">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The settings below allow one to configure the flush policy to flush data after a period of time or&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-50">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # every N messages (or both). This can be done globally and overridden on a per-topic basis.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-51">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-52">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # Per-topic overrides for log.flush.interval.ms&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-53">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #log.flush.intervals.ms.per.topic=topic1:1000, topic2:3000&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-54">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-55">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Log Retention Policy ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-56">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-57">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The following configurations control the disposal of log segments. The policy can&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-58">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # be set to delete segments after a period of time, or after a given size has accumulated.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-59">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # A segment will be deleted whenever *either* of these criteria are met. Deletion always happens&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-60">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # from the end of the log.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-61">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-62">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The minimum age of a log file to be eligible for deletion&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-63">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                retention
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                hours
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                168
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-64">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-65">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # A size-based retention policy for logs. Segments are pruned from the log as long as the remaining&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-66">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # segments don't drop below log.retention.bytes.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-67">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                #log.retention.bytes=1073741824&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-68">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-69">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The maximum size of a log segment file. When this size is reached a new log segment will be created.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-70">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                segment
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                bytes
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                536870912
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-71">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-72">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # The interval at which log segments are checked to see if they can be deleted according &lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-73">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # to the retention policies&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-74">
               <span class="crayon-v">
                log
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                cleanup
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                interval
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                mins
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-75">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-76">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                ######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##### Zookeeper ###&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;######&lt;/span&gt;&lt;span class="comment"&gt;##&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-77">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-78">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # Zookeeper connection string (see zookeeper docs for details).&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-79">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # This is a comma separated host:port pairs, each corresponding to a zk&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-80">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-81">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # You can also append an optional chroot string to the urls to specify the&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-82">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # root directory for all kafka znodes.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-83">
               <span class="crayon-v">
                zookeeper
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                connect
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                esv4
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-v">
                hcl197
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                grid
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                linkedin
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "attribute"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                com
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                :
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2181
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-84">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-85">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # Timeout in ms for connecting to zookeeper&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-86">
               <span class="crayon-v">
                zookeeper
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                connection
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                timeout
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ms
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-87">
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-88">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # metrics reporter properties&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-89">
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                metrics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                polling
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                interval
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                secs
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                5
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-90">
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                metrics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                reporters
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                metrics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-e">
                KafkaCSVMetricsReporter
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-91">
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                csv
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                metrics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                dir
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                tmp
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                kafka_metrics
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-92">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-p">
                # Disable csv reporting by default.&lt;/span&gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-93">
               <span class="crayon-v">
                kafka
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                csv
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                metrics
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                reporter
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                enabled
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "literal"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-t">
                false
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-94">
              </div>
              <div class="crayon-line" id="crayon-576864eb46ae4139259772-95">
               <span class="crayon-v">
                replica
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                lag
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                max
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                messages
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10000000
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576864eb46ae4139259772-96">
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0824 seconds] -->
       <p>
        读者也可参考另外一份
        <a href="http://liveramp.com/blog/kafka-0-8-producer-performance-2/" rel="external" target="_blank">
         Kafka性能测试报告
        </a>
       </p>
       <h1 id="参考">
        参考
       </h1>
       <ul>
        <li>
         <a href="http://www.oschina.net/translate/top-10-uses-for-message-queue" rel="external" target="_blank">
          使用消息队列的 10 个理由
         </a>
        </li>
        <li>
         <a href="http://kafka.apache.org/" rel="external" target="_blank">
          Apache Kafka
         </a>
        </li>
        <li>
         <a href="http://www.ibm.com/developerworks/library/j-zerocopy/" rel="external" target="_blank">
          Efficient data transfer through zero copy
         </a>
        </li>
        <li>
         <a href="http://engineering.linkedin.com/kafka/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines" rel="external" target="_blank">
          Benchmarking Apache Kafka: 2 Million Writes Per Second (On Three Cheap Machines)
         </a>
        </li>
        <li>
         <a href="http://liveramp.com/blog/kafka-0-8-producer-performance-2/" rel="external" target="_blank">
          Kafka 0.8 Producer Performance
         </a>
        </li>
       </ul>
       <p>
       </p>
       <p>
        文章出处：
        <a href="http://www.jasongj.com/2015/01/02/Kafka%E6%B7%B1%E5%BA%A6%E8%A7%A3%E6%9E%90/">
         http://www.jasongj.com/2015/01/02/Kafka%E6%B7%B1%E5%BA%A6%E8%A7%A3%E6%9E%90/
        </a>
       </p>
      </div>
      <div>
       <strong>
        注：转载文章均来自于公开网络，仅供学习使用，不会用于任何商业用途，如果侵犯到原作者的权益，请您与我们联系删除或者授权事宜，联系邮箱：contact@dataunion.org。转载数盟网站文章请注明原文章作者，否则产生的任何版权纠纷与数盟无关。
       </strong>
      </div>
      <!--content_text-->
      <div class="fenxian">
       <!-- JiaThis Button BEGIN -->
       <div class="jiathis_style_32x32">
        <p class="jiathis_button_weixin">
        </p>
        <p class="jiathis_button_tsina">
        </p>
        <p class="jiathis_button_qzone">
        </p>
        <p class="jiathis_button_cqq">
        </p>
        <p class="jiathis_button_tumblr">
        </p>
        <a class="jiathis jiathis_txt jtico jtico_jiathis" href="http://www.jiathis.com/share" target="_blank">
        </a>
        <p class="jiathis_counter_style">
        </p>
       </div>
       <!-- JiaThis Button END -->
      </div>
     </article>
     <!--content-->
     <!--相关文章-->
     <div class="xianguan">
      <div class="xianguantitle">
       相关文章！
      </div>
      <ul class="pic">
       <li>
        <a href="http://dataunion.org/20348.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/08/t0123c56de49c9c3de9_副本.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/20348.html" rel="bookmark" title="Apache kafka 工作原理介绍">
         Apache kafka 工作原理介绍
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/17905.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/05/t0123c56de49c9c3de9-300x225.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/17905.html" rel="bookmark" title="Kafka设计解析（二） Kafka High Availability （上）">
         Kafka设计解析（二） Kafka High Availability （上）
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/17873.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/05/t0123c56de49c9c3de9-300x225.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/17873.html" rel="bookmark" title="Kafka设计解析（一） Kafka背景及架构介绍">
         Kafka设计解析（一） Kafka背景及架构介绍
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/16662.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/05/t013d48bf948186f511-300x148.png"/>
        </a>
        <a class="link" href="http://dataunion.org/16662.html" rel="bookmark" title="Kafka文件存储机制那些事">
         Kafka文件存储机制那些事
        </a>
       </li>
      </ul>
     </div>
     <!--相关文章-->
     <div class="comment" id="comments">
      <!-- You can start editing here. -->
      <!-- If comments are open, but there are no comments. -->
      <div class="title">
       期待你一针见血的评论，Come on！
      </div>
      <div id="respond">
       <p>
        不用想啦，马上
        <a href="http://dataunion.org/wp-login.php?redirect_to=http%3A%2F%2Fdataunion.org%2F9307.html">
         "登录"
        </a>
        发表自已的想法.
       </p>
      </div>
     </div>
     <!-- .nav-single -->
    </div>
    <!--Container End-->
    <aside id="sitebar">
     <div class="sitebar_list2">
      <div class="wptag">
       <span class="tagtitle">
        热门标签+
       </span>
       <div class="tagg">
        <ul class="menu" id="menu-%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1605" id="menu-item-1605">
          <a href="http://taidizh.com/">
           泰迪智慧
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20884" id="menu-item-20884">
          <a href="http://www.transwarp.cn/">
           星环科技
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-3538" id="menu-item-3538">
          <a href="http://datall.org/">
           珈和遥感
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20888" id="menu-item-20888">
          <a href="http://www.chinahadoop.cn/">
           小象学院
          </a>
         </li>
        </ul>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <div class="textwidget">
       <div align="center">
        <a href="http://study.163.com/course/courseMain.htm?courseId=991022" target="_blank">
         <img src="http://dataunion.org/wp-content/uploads/2016/03/dv.jpg"/>
        </a>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       文章分类
      </h4>
      <div class="tagcloud">
       <a class="tag-link-44" href="http://dataunion.org/category/industry/demo" style="font-size: 10.204724409449pt;" title="4个话题">
        Demo展示
       </a>
       <a class="tag-link-31" href="http://dataunion.org/category/experts" style="font-size: 15.826771653543pt;" title="52个话题">
        专家团队
       </a>
       <a class="tag-link-870" href="http://dataunion.org/category/tech/ai" style="font-size: 19.795275590551pt;" title="273个话题">
        人工智能
       </a>
       <a class="tag-link-488" href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f" style="font-size: 8pt;" title="1个话题">
        加入数盟
       </a>
       <a class="tag-link-869" href="http://dataunion.org/category/tech/viz" style="font-size: 17.204724409449pt;" title="93个话题">
        可视化
       </a>
       <a class="tag-link-30" href="http://dataunion.org/category/partners" style="font-size: 10.645669291339pt;" title="5个话题">
        合作伙伴
       </a>
       <a class="tag-link-889" href="http://dataunion.org/category/parterc" style="font-size: 11.582677165354pt;" title="8个话题">
        合作会议
       </a>
       <a class="tag-link-104" href="http://dataunion.org/category/books" style="font-size: 12.96062992126pt;" title="15个话题">
        图书
       </a>
       <a class="tag-link-220" href="http://dataunion.org/category/tech/base" style="font-size: 19.850393700787pt;" title="281个话题">
        基础架构
       </a>
       <a class="tag-link-219" href="http://dataunion.org/category/tech/analysis" style="font-size: 19.409448818898pt;" title="232个话题">
        数据分析
       </a>
       <a class="tag-link-887" href="http://dataunion.org/category/tech/dm" style="font-size: 13.291338582677pt;" title="17个话题">
        数据挖掘
       </a>
       <a class="tag-link-34" href="http://dataunion.org/category/tech" style="font-size: 20.732283464567pt;" title="404个话题">
        文章
       </a>
       <a class="tag-link-1" href="http://dataunion.org/category/uncategorized" style="font-size: 22pt;" title="693个话题">
        未分类
       </a>
       <a class="tag-link-4" href="http://dataunion.org/category/events" style="font-size: 14.503937007874pt;" title="29个话题">
        活动
       </a>
       <a class="tag-link-890" href="http://dataunion.org/category/tech/%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0" style="font-size: 10.204724409449pt;" title="4个话题">
        深度学习
       </a>
       <a class="tag-link-221" href="http://dataunion.org/category/tech/devl" style="font-size: 18.968503937008pt;" title="193个话题">
        编程语言
       </a>
       <a class="tag-link-888" href="http://dataunion.org/category/career" style="font-size: 15.661417322835pt;" title="48个话题">
        职业规划
       </a>
       <a class="tag-link-5" href="http://dataunion.org/category/jobs" style="font-size: 14.11811023622pt;" title="25个话题">
        职位
       </a>
       <a class="tag-link-871" href="http://dataunion.org/category/industry" style="font-size: 15.716535433071pt;" title="49个话题">
        行业
       </a>
       <a class="tag-link-613" href="http://dataunion.org/category/industry/case" style="font-size: 16.984251968504pt;" title="84个话题">
        行业应用
       </a>
       <a class="tag-link-885" href="http://dataunion.org/category/industry/news" style="font-size: 17.425196850394pt;" title="102个话题">
        行业资讯
       </a>
       <a class="tag-link-10" href="http://dataunion.org/category/training" style="font-size: 14.228346456693pt;" title="26个话题">
        课程
       </a>
       <a class="tag-link-16" href="http://dataunion.org/category/sources" style="font-size: 15.661417322835pt;" title="48个话题">
        资源
       </a>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       功能
      </h4>
      <ul>
       <li>
        <a href="http://dataunion.org/wp-login.php?action=register">
         注册
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/wp-login.php">
         登录
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/feed">
         文章
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/comments/feed">
         评论
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="https://cn.wordpress.org/" title="基于WordPress，一个优美、先进的个人信息发布平台。">
         WordPress.org
        </a>
       </li>
      </ul>
     </div>
    </aside>
    <div class="clear">
    </div>
   </div>
   <!--main-->
   ﻿
   <footer id="dibu">
    <div class="about">
     <div class="right">
      <ul class="menu" id="menu-%e5%ba%95%e9%83%a8%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18024" id="menu-item-18024">
        <a href="http://dataunion.org/category/partners">
         合作伙伴
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20881" id="menu-item-20881">
        <a href="http://dataunion.org/contribute">
         文章投稿
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20872" id="menu-item-20872">
        <a href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f">
         加入数盟
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22441" id="menu-item-22441">
        <a href="http://dataunion.org/f-links">
         友情链接
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20874" id="menu-item-20874">
        <a href="http://dataunion.org/aboutus">
         关于数盟
        </a>
       </li>
      </ul>
      <p class="banquan">
       数盟社区        ，
        做最棒的数据科学社区
      </p>
     </div>
     <div class="left">
      <ul class="bottomlist">
       <li>
        <a href="http://weibo.com/DataScientistUnion  " target="_blank" 　title="">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weibo.png"/>
        </a>
       </li>
       <li>
        <a class="cd-popup-trigger" href="http://dataunion.org/9307.html#0">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weixin.png"/>
        </a>
       </li>
      </ul>
      <div class="cd-popup">
       <div class="cd-popup-container">
        <h1>
         扫描二维码,加微信公众号
        </h1>
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/2014-12-06-1515289049.png"/>
        <a class="cd-popup-close" href="http://dataunion.org/9307.html">
        </a>
       </div>
       <!-- cd-popup-container -->
      </div>
      <!-- cd-popup -->
     </div>
    </div>
    <!--about-->
    <div class="bottom">
     <a href="http://dataunion.org/">
      数盟社区
     </a>
     <a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank">
      京ICP备14026740号
     </a>
     联系我们：
     <a href="mailto:contact@dataunion.org" target="_blank">
      contact@dataunion.org
     </a>
     <div class="tongji">
     </div>
     <!--bottom-->
     <div class="scroll" id="scroll" style="display:none;">
      ︿
     </div>
    </div>
   </footer>
   <!--dibu-->
  </div>
 </body>
</html>